home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d1 / amac34.arc / SIZE13.QM < prev    next >
Text File  |  1991-02-16  |  9KB  |  185 lines

  1. *                               SIZE13.QM, 1.3b
  2. *                   Macros To Show Byte Size of Macros
  3.  
  4.  
  5. * @9 Shows byte size of ALL    macros in a txtfile.
  6. * @0 Shows byte size of SINGLE macro.
  7.  
  8.  
  9. * SIZE13.QM are QEdit macros to quickly show byte size of a macro
  10. * added to the end of the macro with an asterisk and space in column 1.
  11. * See the end of each of these macros for byte size.
  12.  
  13. * The beeps you hear when executing @9 are finding and bypassing
  14. * paragraphs that are not macros.
  15.  
  16. * These macros require "QEdit and QMAC v2.1, February, 1990" or later.
  17. *
  18. * To BEGIN, just type "START SIZE" <Enter>. All pertinent files will be
  19. * loaded in the "Ring" for viewing, and SIZE13.MAC is read.
  20. * Alternatively, type "START SIZE 0" <Enter> and the disk copies of all
  21. * files in the "Ring" will be loaded ready for editing, saving time.
  22.  
  23.  
  24. * Version History:
  25.  
  26. *         1.0  - Initial
  27. *         1.1  - Added Alt_9 to show size of all macros in txtfile
  28. *         1.1a - Modified @9 for paragraphs that are not macros
  29. *         1.1b-  Changed other file names in series, this is an update.
  30. *         1.2 -  Changed documentation only.
  31. *             -  Changed .LST and .QL files.
  32. *         1.3 -  Modified macros slightly, @0 now checks if
  33. *                paragraph is a macro, like @9.
  34. *         1.3a - Removed [d:]\[path] for location of QMAC from QMACB.BAT
  35. *                files. QMAC can be located anywhere in path.
  36. *         1.3b - Modified documentation and added START.BAT.
  37.  
  38. * For other macros see ALLMACRO.INF.
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45. *┌───────────────────────────────────────────────────────┐
  46. *│ @9 Macro to show byte size of ALL macros in a txtfile │
  47. *└───────────────────────────────────────────────────────┘
  48.  
  49. * To run, cursor may be anywhere in a txtfile. Press Alt and 9 at the
  50. * same time, and the size of each macro is added at the end of each
  51. * macro with an asterisk in column 1. Macros must be paragraphs with
  52. * no blank lines, but paragraphs need NOT contain macros.
  53. * Insert must be ON.
  54.  
  55. @9 macrobegin
  56.         begfile                         * get to begin of file
  57.         unmarkblock insertline begline  * insert temp line
  58.         dropanchor currentfilename      *
  59.         storescrbuff "1" return         * get to scrbuff 1
  60.         cut                             * delete temp line
  61.         cursordown                      * move into macro
  62.  jtrue LASTLINE:                        * if cannot cursor down
  63.         endfile                         * are at endfile-no blank line
  64.         addline                         * put blank line
  65.         prevpara                        * go to parA Begin
  66.  jump NEXT:                             * bypass lastline:
  67.  LASTLINE:                              * if can cursor down
  68.         prevpara begline                * go to para Begin
  69.  NEXT:                                  * get ready to mark
  70.         markblockbegin                  * mark para Block begin
  71.         endpara                         * go to para end
  72.         markblockend                    * mark para end
  73.         gotoblockbeg                    * get ready to chech if macro
  74.         FIND "macrobegin" return        * check if para is macro
  75.         "LI" return                     *
  76.  jtrue HASMACRO:                        * if para macro, go to HASMACRO
  77.         nextpara                        * if para not macro, nextpara
  78.  jfalse END:                            * end if last para not macro
  79.         unmarkblock                     * and unmark non-macro para
  80.  jump NEXT:                             * go back to NEXT, or
  81.  HASMACRO:                              * come here if para is macro
  82.         gotoblockend                    * get back to para end
  83.         writeblock "C:$.qm" return      * write macro block to C:$.qm
  84.         return                          * put line at end of macro
  85.         editfile return quit            * quit temp file from ring
  86.         editfile return                 * load macro block txtfile
  87.         DOS "qmacb " currentfilename    * make macfile of macro block
  88.         backspace backspace backspace   * remove '.qm'
  89.         return return                   * return from Dos
  90.         DOS "dir " currentfilename      * get macfile size with Dir
  91.         backspace backspace             * delete 'qm'
  92.        "mac >C:!"                       * add "mac", save list to temp
  93.         return return                   * back from Dos
  94.         killfile quit                   * kill/quit C:$.qm
  95.         editfile "C:!" return           * load Dir listing of macfile
  96.         gotoline "4" return             * drop down
  97.         wordright wordright markword    * mark size
  98.         storescrbuff "2" return         * get size to scrapbuff 2
  99.         killfile quit                   * kill/quit C:!
  100.         getscrbuff "1" return           * insert orig file name
  101.         cut                             * get to scrap
  102.         editfile paste return           * load orig file
  103.         begline                         * begline
  104.        "*" cursorright                  * put asterisk in column 1
  105.         getscrbuff "2" return           * insert byte size of macro
  106.         endline cursorright "bytes"     * add "bytes"
  107.         cursorright                     * space
  108.         insertdate inserttime           * insert date and time
  109.         nextpara                        * go to next para
  110.  jfalse END:                            * stop if no more para
  111.         jump NEXT:                      * go to next if more para
  112.  END:                                   *
  113. *
  114. * 200 bytes Thu  09-13-1990  19:13:19
  115.  
  116.  
  117.  
  118. *┌─────────────────────────────────────────────┐
  119. *│ @0 Macro to show byte size of SINGLE macro. │
  120. *└─────────────────────────────────────────────┘
  121.  
  122. * Place cursor line anywhere in a txtfile macro and press Alt_0. Macro
  123. * size is added at the end of the macro as shown below. Macro must be a
  124. * paragraph with NO blank lines. If the paragraph does NOT contain a
  125. * macro, the macro stops executing with a beep, meaning "macro_begin"
  126. * was not found in the paragraph. Insert must be ON.
  127.  
  128. @0 macrobegin
  129.         unmarkblock insertline begline  * insert temp line
  130.         dropanchor currentfilename      *
  131.         storescrbuff "1" return         * get to scrbuff 1
  132.         cut                             * delete temp line
  133.         cursordown                      * move into macro
  134.  jtrue LASTLINE:                        * if cannot cursor down
  135.         endfile                         * are at endfile-no blank line
  136.         addline                         * put blank line
  137.         prevpara                        * go to parA Begin
  138.  jump NEXT:                             * bypass lastline:
  139.  LASTLINE:                              * if can cursor down
  140.         prevpara begline                * go to macro begin
  141.  NEXT:                                  * get ready to mark
  142.         markblockbegin                  * mark macro block begin
  143.         endpara                         * go to macro end
  144.         markblockend                    * mark macro end
  145.         gotoblockbeg                    * get to para begin
  146.         FIND "macrobegin" return        * check if para is macro
  147.         "LI" return                     *
  148.  jtrue HASMACRO:                        * if para macro, go to HASMACRO
  149.         unmarkblock                     * if not unmark and end
  150.  jump END:                              *
  151.  HASMACRO:                              * come here if para has macro
  152.         gotoblockend                    * get back to para end
  153.         writeblock "C:$.qm" return      * write macro block to C:$.qm
  154.         return                          * put line at end of macro
  155.         editfile return quit            * quit temp file from ring
  156.         editfile return                 * load macro block txtfile
  157.         DOS "qmacb " currentfilename    * make macfile of macro block
  158.         backspace backspace backspace   * remove '.qm'
  159.         return return                   * return from Dos
  160.         DOS "dir " currentfilename      * get macfile size with Dir
  161.         backspace backspace             * delete 'qm'
  162.        "mac >C:!"                       * add 'mac", save list to temp
  163.         return return                   * back fom nns
  164.         killfile quit                   * kill/quit C:$.qm
  165.         editfile "C:!" return           * load Dir listing of macfile
  166.         gotoline "4" return             * drop down
  167.         wordright wordright markword    * mark size
  168.         storescrbuff "2" return         * get size to scrapbuff 2
  169.         killfile quit                   * kill/quit C:!
  170.         getscrbuff "1" return           * insert orig file name
  171.         cut                             * get to scrap
  172.         editfile paste return           * load orig file                        * edit currentfilename
  173.         begline                         * begline
  174.        "*" cursorright                  * put asterisk in column 1
  175.         getscrbuff "2" return           * insert byte size of macro
  176.         endline cursorright "bytes"     * add "bytes"
  177.         cursorright                     * space
  178.         insertdate inserttime           * insert date and time
  179.         makectrofscreen                 * better view
  180.  END:
  181. *
  182. * 189 bytes Thu  09-13-1990  19:13:24
  183.  
  184. * ...Tom Hogshead  Wed  10-31-1990
  185.